<template>
  <el-dialog
    title="待办任务"
    :visible.sync="dialogVisible"
    width="90%">
    <div class="dialog-main">
      <el-table
        size="small"
        v-loading="loading"
        :data="tableData"
        height="250"
        border
        style="width: 100%">
        <el-table-column
          prop="status"
          label="状态"
          width="80">
          <template slot-scope="{row}">
              <el-tag size="small" :type="['danger','info'][row.status]">{{['待办','已办'][row.status]}}</el-tag>
          </template>
        </el-table-column>
        <el-table-column
          prop="taskName"
          label="环节名称"
          width="180">
        </el-table-column>
        <el-table-column
          prop="realName"
          label="审批人">
        </el-table-column>
        <el-table-column
          prop="deptName"
          label="部门名称">
        </el-table-column>
        <el-table-column
          prop="startDate"
          width="150"
          label="开始时间">
        </el-table-column>
        <el-table-column
          prop="endDate"
          width="150"
          label="结束时间">
        </el-table-column>
        <el-table-column
                prop="endDate"
                width="80"
                label="操作">
          <template slot-scope="{row}">
            <el-tag v-if="row.commentType!=null" size="small" :type="['info','success','danger'][row.commentType]">{{['待审批','同意','驳回'][row.commentType]}}</el-tag>
          </template>
        </el-table-column>
        <el-table-column
          prop="comment"

          label="意见">
        </el-table-column>
      </el-table>
    </div>
    <span slot="footer" class="dialog-footer">
      <el-button type="primary" @click="dialogVisible = false" size="small">确 定</el-button>
    </span>
  </el-dialog>
</template>

<script>
    import {list} from '@/api/Todo'
    export default {
        components: {},
        data() {
            return {
                dialogVisible:false,
                loading:false,
                tableData:[],
            }
        },
        computed:{

        },
        methods: {
            open(processInstanceId) {
                this.dialogVisible = true
                this.loading = true
                list({processInstanceId,pageSize:9999}).then(res=>{
                    this.tableData = res.data.records
                }).finally(()=>{
                    this.loading = false
                })
            },
        }
    }
</script>

<style scoped lang="scss">

</style>
